home *** CD-ROM | disk | FTP | other *** search
- ' SimpleInfo...
- ' a nice clean application to give you all the simplest information
- ' about your macintosh computer...
- ' Copyright 1995 pdgm (Damon Law). All rights reserved. No patents
- ' pending…
-
- ' I wrote this because I bought a new monitor and I needed to know
- ' what the hell the pixel dimensions were… This is oficially version 2.0
- ' because I wrote another version (1.0 - der!) to do the same thing
- ' once I figured out I could get screen dimensions without having to
- ' dig through literature! So here's the code…
-
- ' The source code and auxillary files are provided for humour value, but
- ' if you decide to yank even the slightest bit - you should consider
- ' giving me credit. If you _learn_ something please tell me.
-
- ' I can be reached at DamonLaw@aol.com
-
- ' All orginization techniques are purely coincidental.
-
-
-
- COMPILE 0,_dimmedVarsOnly
- RESOURCES "SimpleInfo.res","APPLwhat"
-
-
-
- ' constants________________________________________________pdgm
-
- _mainWnd =1
- _aboutWnd = 2
-
-
-
- ' globals__________________________________________________pdgm
-
- DIM gProgramEnds
- DIM mainGraphic&,mainGraphicRect.8
- DIM screenWidth,screenHeight,systemVers,maxColors,currentDepth,cpu,mach
- DIM cpuRect.8,machRect.8,sysVersRect.8,scrnSizeRect.8,scrnDpthRect.8
- DIM cpu$,mach$,sysVers$,scrnSize$,scrnDpth$
- END GLOBALS
-
-
-
- ' conjuction-junction, what's your…
- ' functions________________________________________________pdgm
-
-
- LOCAL FN doDialog
- DIM evnt,id
-
- evnt = DIALOG(0)
- id = DIALOG(evnt)
- SELECT evnt
- CASE _wndClick 'Window clicked.
- WINDOW id 'Activate clicked Window.
- CASE _wndClose 'Window Wants to be closed.
- WINDOW CLOSE id 'Otherwise close window.
- CASE ELSE
- END SELECT
- END FN
-
-
- LOCAL FN doAbout
- DIM swc,about&,about$
-
- LONG IF WINDOW(-_aboutWnd)=_false
- swc=(SYSTEM(_scrnWidth)/2)-1
- WINDOW CLOSE _aboutWnd
- WINDOW -_aboutWnd,"About SimpleInfo…",(swc-149,103)-(swc+150,218),_docNoGrow
- PICTURE FIELD -7,"pdgm logo (Icon)",(6,6)-(37,37),_statNoFramed,_cropPict
-
- about&=0
- PICTURE ON
- COLOR _zBlack 'just in case the pen got switched
- PEN ,,,,3
- PLOT 42,5 TO 42,110
- TEXT _sysfont,12
- CALL MOVETO (46,14) : PRINT "SimpleInfo"
- TEXT _geneva,9
- CALL MOVETO (48,50) :PRINT "Damon Law"
- CALL MOVETO (48,65) :PRINT "Thank you:"
- CALL MOVETO (48,80) :PRINT "Dallas / Portland / Seattle"
- CALL MOVETO (48,105) :PRINT "© MCMXCV (1995) pdgm";
- CALL MOVETO (230,105):PRINT "Version 2.0";
- PICTURE OFF, about&
- DEFSTR LONG
- about$="&"+MKI$(about&)
- PICTURE FIELD -8, about$, (0,0)-(300,115), _statNoFramed+_statKeepBg,_cropPict
- WINDOW _aboutWnd
- XELSE
- WINDOW _aboutWnd
- END IF
-
- END FN
-
-
- LOCAL FN closeAllWindows
-
- ' This is one of my fovorite pieces of code EVER!
- ' “I made this!”
-
- DO
- WINDOW CLOSE WINDOW(_activeWnd)
- UNTIL WINDOW(_activeWnd)=0
-
- END FN
-
-
- LOCAL FN doMenu
- DIM whichMenu,whatItem 'This is minimalistic…
-
- whichMenu=MENU(0)
- whatItem=MENU(1)
-
- SELECT CASE whichMenu
- CASE 1000 'FILE MENU
- SELECT CASE whatItem
-
- CASE 1 'Close
- LONG IF WINDOW(-_activeWnd)=_aboutWnd
- WINDOW CLOSE _aboutWnd
- XELSE 'Close all windows & split!
- FN closeAllWindows
- CALL INITCURSOR
- END 'Get the hell out!
- END IF
-
- CASE 2 'Quit (regardless…)
- FN closeAllWindows
- CALL INITCURSOR
- END 'wah-hoo!
-
- CASE ELSE
- END SELECT
- CASE 127 'APPLE MENU
- IF whatItem=1 THEN FN doAbout
- CASE ELSE
- END SELECT
-
- MENU
-
- END FN
-
-
- LOCAL FN initialize
-
- ' Ooh! I'm pushing the limits of quickdraw here!
-
- CALL SETRECT (mainGraphicRect,0,0,299,210)
- CALL SETRECT (cpuRect,46,48,263,61)
- CALL SETRECT (machRect,46,83,263,96)
- CALL SETRECT (sysVersRect,46,118,263,131)
- CALL SETRECT (scrnSizeRect,46,152,263,165)
- CALL SETRECT (scrnDpthRect,46,186,263,199)
-
- ' egad! I thought it couldn't be done in 7 lines of code!
-
- cpu = SYSTEM(_cpuType)
- mach = SYSTEM(_machType)
- systemVers = SYSTEM(_sysVers)
- screenWidth = SYSTEM(_scrnWidth)
- screenHeight = SYSTEM(_scrnHeight)
- maxColors = SYSTEM(_maxColors)
- currentDepth = SYSTEM(_crntDepth)
-
- END FN
-
-
- LOCAL FN checkItOut
-
- ' Yeah I should have done this with constants so that
- ' Hajimoto could READ it if it ever got to Japan…
-
- SELECT CASE cpu
- CASE _env68000
- cpu$ = "68000 processor"
- CASE _env68010
- cpu$ = "68010 processor"
- CASE _env68020
- cpu$ = "68020 processor"
- CASE _env68030
- cpu$ = "68030 processor"
- CASE _env68040
- cpu$ = "68040 processor"
- CASE ELSE
- cpu$ = "? (unknown processor)"
- END SELECT
-
- SELECT CASE mach
- CASE _envMachUnknown
- mach$ = "? (unknown Macintosh model)"
- CASE _envXL
- mach$ = "Macintosh XL"
- CASE _envMac
- mach$ = "Macintosh (Original)"
- CASE _env512KE
- mach$ = "Macintosh 512k enhanced"
- CASE _envMacPlus
- mach$ = "Macintosh Plus"
- CASE _envSE
- mach$ = "Macintosh SE"
- CASE _envMacII
- mach$ = "Macintosh II"
- CASE _envMacIIx
- mach$ = "Macintosh IIx"
- CASE _envMacIIcx
- mach$ = "Macintosh IIcx"
- CASE _envSE30
- mach$ = "Macintosh SE/30"
- CASE _envPortable
- mach$ = "Macintosh Portable"
- CASE _envMacIIci
- mach$ = "Macintosh IIci"
- CASE _envMacIIfx
- mach$ = "Macintosh IIfx (wicked fast)"
- CASE ELSE
- mach$ = "? (unknown Macintosh model)"
- END SELECT
-
- sysVers$ = "System software version"+LEFT$(STR$(systemVers),2)+"."
- sysVers$ = sysVers$ + MID$(STR$(systemVers),3,1)+"." + RIGHT$(STR$(systemVers),1)
-
- scrnSize$ = RIGHT$(STR$(screenWidth),LEN(STR$(screenWidth))-1)
- scrnSize$ = scrnSize$ + " pixels by" + STR$(screenHeight) + " pixels"
-
- SELECT CASE maxColors
- CASE 1
- scrnDpth$ = "1 bit (Blue & White)"
- CASE 2
- scrnDpth$ = "up to 2 bit (4 colors)"
- CASE 4
- scrnDpth$ = "up to 4 bit (16 colors)"
- CASE 8
- scrnDpth$ = "up to 8 bit (256 colors)"
- CASE 24
- scrnDpth$ = "up to 24 bit (32,000 colors)"
- CASE 32
- scrnDpth$ = "up to 32 bit (16 million colors)"
- CASE ELSE
- scrnDpth$ = "? (unknown bit-depth/color limit)"
- END SELECT
-
- END FN
-
-
- LOCAL FN setItUp
-
- ' Pretty self explanitory…
- ' Turned the AUTOCLIP off to try and increase speed.
-
- WINDOW -_mainWnd,,@mainGraphicRect,_docNoGrow+_noGoAway
- AUTOCLIP = _false
- PICTURE FIELD 1,"8bit",@mainGraphicRect,_statNoFramed+_statKeepBg,_cropPict
- EDIT FIELD 2,cpu$,@cpuRect,_statFramed,_leftJust
- EDIT FIELD 3,mach$,@machRect,_statFramed,_leftJust
- EDIT FIELD 4,sysVers$,@sysVersRect,_statFramed,_leftJust
- EDIT FIELD 5,scrnSize$,@scrnSizeRect,_statFramed,_leftJust
- EDIT FIELD 6,scrnDpth$,@scrnDpthRect,_statFramed,_leftJust
- WINDOW _mainWnd
-
- END FN
-
-
-
- ' start____________________________________________________pdgm
-
- WINDOW OFF 'damn thing!
- BREAK OFF 'darned switches!!
- EDIT MENU -2 'kick the EDIT menu in…
- ON MENU FN doMenu 'power that stuff up…
- ON DIALOG FN doDialog 'fuel this sucker…
-
- FN initialize 'load the variables
- FN checkItOut 'scan the system
- FN setItUp 'show gathered info
-
-
-
- ' main_____________________________________________________pdgm
-
- DO
- ' eternal loop
- HANDLEEVENTS
- UNTIL gProgramEnds
-
-